package com.gongpingjialoan.utility;

import android.content.Context;

import com.gongpingjialoan.api.API;
import com.gongpingjialoan.data.UserManager;
import com.gongpingjialoan.global.GPJApplication;
import com.gongpingjialoan.network.NetDataJson;
import com.gongpingjialoan.network.NetDataJson.OnNetDataJsonListener;

import org.json.JSONObject;

public class StepRecord {
    public static void recordStep(Context context, String activity, String parms) {
            NetDataJson mNetDataJson = new NetDataJson(new OnNetDataJsonListener() {

                @Override
                public void onDataJsonUpdate(JSONObject json) {

                }

                @Override
                public void onDataJsonError(String errorMessage) {

                }
            });
            mNetDataJson.setUrl(API.stepRecord);
            mNetDataJson.addParam("device_code", GPJApplication.getInstance().getDeviceCode());
            mNetDataJson.addParam("device", "android_" + GPJApplication.getInstance().channel);
            mNetDataJson.addParam("version", GPJApplication.getInstance().getVersion());
            UserManager mUserManager = new UserManager(context);
            mUserManager = mUserManager.LoadUserInfo();
            mNetDataJson.addParam("phone", mUserManager.getPhone());
            mNetDataJson.addParam("parameter", parms);
            mNetDataJson.addParam("activity", activity);
            mNetDataJson.request("post");
    }
}
